Prevention of Anomalies in Isolation Levels

In this lesson, we will identify which isolation level prevents which anomalies.

Isolation level that prevents all of the anomalies#

There is one isolation level that prevents all of these anomalies: the serializable one.

Like the consistency models presented in the Consistency Models lesson, this level provides a more formal specification of what is possible, e.g., which execution histories are possible. More specifically, it guarantees that the result of the execution of concurrent transactions is the same as that produced by some serial execution of the same transactions. This means that we can only analyze serial executions for defects. If all the possible serial executions are safe, then any concurrent execution by a system at the serializable level will also be safe.

However, serializability has performance costs since it intentionally reduces concurrency to guarantee safety.

Other isolation levels#

Isolation levels other than the serializable ones are less strict and provide better performance via increased concurrency at the cost of decreased safety.

These models allow some of the anomalies we described previously. The following illustration contains a table with the most basic isolation levels, along with the anomalies they prevent.

Isolation levels and prevented anomalies


Dirty Writes

Dirty Reads

Fuzzy Reads

Phantom Reads

Lost Updates

Read Skew

Write Skew

Read Uncommitted

not possible

possible

possible

possible

possible

possible

possible

Read Committed

not possible

not possible

possible

possible

possible

possible

possible

Snapshot Isolation

not possible

not possible

not possible

possible

not possible

not possible

possible

Repeatable Read

not possible

not possible

not possible

possible

not possible

not possible

not possible

Serializability

not possible

not possible

not possible

not possible

not possible

not possible

not possible

These isolation levels originated from the early relational database systems that were not distributed. Still, they are applicable in distributed datastores too.

Isolation Levels and Anomalies
Consistency and Isolation
Mark as Completed
Report an Issue